import React, { Component } from 'react';
import { TenantC, TenantDepartmentC, SecondHeaderC } from '../../../comps';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';

class Tenant extends Component {
  constructor(props) {
    super(props);
    this.state = {
      loading: true,
    };
  }

  render() {
    return (
      <div style={{ width: '800px', padding: '20px' }}>
        <div>
          <SecondHeaderC title='租户' />
          <Form>
            <TenantC form={this.props.form} dataIndex='tenant' helper='lalal' onChange={(e) => console.log(e)} />
            <TenantC form={this.props.form} dataIndex='tenant1' onChange={(e) => console.log(e)} rules={[{ required: true, message: '请选择租户!' }]} multiple={true} />
            <SecondHeaderC title={localStorage.getItem('antd-pro-superMan') == 'true' ? '租户+部门（超户）' : '租户+部门（普通用户）'} />
            <TenantDepartmentC
              form={this.props.form}
              dataIndex='tenantDepartmentC'
              firstInit={true}
              tenantOnChange={(e) => console.log(e)}
              departmentChange={(e) => console.log(e)}
            />
          </Form>
        </div>
      </div>
    );
  }
}

export default Form.create()(Tenant);
